package com.zkthink.ceres.store.dao;

import com.zkthink.base.mapper.SuperMapper;
import com.zkthink.ceres.store.entity.StoreMember;
import com.zkthink.ceres.store.vo.VerifyVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * 会员和店铺关系表
 * </p>
 *
 * @author chenke
 * @date 2022-04-22
 */
@Repository
public interface StoreMemberMapper extends SuperMapper<StoreMember> {
  @Delete(" delete from ceres_store_member where mid = #{mid}")
    int deleteByMid(Long mid);

    /**
     * 查询店铺核销人员
     * @param storeId
     * @return
     */
    List<VerifyVo> verify(Long storeId);
    @Select("select * from ceres_store_member where mid = #{mid} and store_id = #{storeId}")
    StoreMember findByMid(@Param("mid") Long mid,@Param("storeId") Long storeId);
  @Select("select * from ceres_store_member where mid = #{mid} ")
  StoreMember selectByMid(@Param("mid") Long mid);
  @Delete(" delete from ceres_store_member where store_id = #{storeId}")
  int deleteByStoreId(Long storeId);
}
